package com.yilin.platform.base_core.application;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.ser.Serializers;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import java.util.Date;

@MappedSuperclass
public class CapitalBaseEntity extends BaseEntity {
    @Column(name = "trade_no")
    @FlowField(name = "tradeNo")
    private String tradeNo;//本地流水号
    @Column(name = "initiate_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date initiateTime;//发起时间
    @Column(name = "complete_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @FlowField(name = "tradesDate")
    private Date completeTime;//完成时间
    @Column(name = "notified_yilin")
    private Boolean notifiedYilin=false;//是否已通知主服务器
    @Column(name = "notify_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date notifyTime;//通知时间  通知完成时间
    @Column(name = "next_notification_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date nextNotificationTime = new Date();//下次通知时间  表示为通知的订单下次通知时间
    @Column(name = "sync_task_count")
    private Integer syncTaskCount = 0;//自动任务次数
    @Column(name = "bank_flow_no")
    @FlowField(name = "bankFlowNo")
    private String bankFlowNo;//银行流水号（银行/第三方)
    @Column(name ="tran_amount")
    @FlowField(name = "money")
    private Double tranAmount;//转出金额  *
    @FlowField(name = "holderOrganizeId")
    @Column(name ="out_organize_id")
    private String outOrganizeId;//付款人[平台]组织ID
    @Column(name ="out_acct_name")
    @FlowField(name = "holderName")
    private String outAcctName;//付款人名称*
    @Column(name ="out_acct_no")
    @FlowField(name = "holderBankAccNo")
    private String outAcctNo;//付款人账*
    @Column(name = "in_organize_id")
    @FlowField(name = "targetOrganizeId")
    private String inOrganizeId;//收款人[平台]组织ID
    @Column(name ="in_acct_name")
    @FlowField(name = "targetName")
    private String inAcctName;//收款人账户户名 *
    @Column(name ="in_acct_no")
    @FlowField(name = "targetBankAccNo")
    private String inAcctNo;//收款人账户
    @Column(name = "bank_msg")
    private String bankMsg;//银行返回信息
    @TableLogic
    @Column(name = "is_deleted", columnDefinition = "INT default 0")
    private Integer isDeleted;
    @Version()
    @Column(name = "version", columnDefinition = "INT default 0")
    private Integer version = 0;
    @Column(name = "next_wait_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date nextWaitTime = new Date();//交易处理中的下次查询时间
    @Column(name = "query_wait_count")
    private Integer queryWaitCount = 0;//查询次数

    public Date getNextWaitTime() {
        return nextWaitTime;
    }

    public void setNextWaitTime(Date nextWaitTime) {
        this.nextWaitTime = nextWaitTime;
    }

    public Integer getQueryWaitCount() {
        return queryWaitCount;
    }

    public void setQueryWaitCount(Integer queryWaitCount) {
        this.queryWaitCount = queryWaitCount;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public Date getInitiateTime() {
        return initiateTime;
    }

    public String getBankMsg() {
        return bankMsg;
    }

    public void setBankMsg(String bankMsg) {
        this.bankMsg = bankMsg;
    }

    public void setInitiateTime(Date initiateTime) {
        this.initiateTime = initiateTime;
    }

    public Date getCompleteTime() {
        return completeTime;
    }

    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }

    public Boolean getNotifiedYilin() {
        return notifiedYilin;
    }

    public void setNotifiedYilin(Boolean notifiedYilin) {
        this.notifiedYilin = notifiedYilin;
    }

    public Date getNotifyTime() {
        return notifyTime;
    }

    public void setNotifyTime(Date notifyTime) {
        this.notifyTime = notifyTime;
    }

    public Date getNextNotificationTime() {
        return nextNotificationTime;
    }

    public void setNextNotificationTime(Date nextNotificationTime) {
        this.nextNotificationTime = nextNotificationTime;
    }

    public Integer getSyncTaskCount() {
        return syncTaskCount;
    }

    public void setSyncTaskCount(Integer syncTaskCount) {
        this.syncTaskCount = syncTaskCount;
    }

    public String getBankFlowNo() {
        return bankFlowNo;
    }

    public void setBankFlowNo(String bankFlowNo) {
        this.bankFlowNo = bankFlowNo;
    }

    public Double getTranAmount() {
        return tranAmount;
    }

    public void setTranAmount(Double tranAmount) {
        this.tranAmount = tranAmount;
    }

    public String getOutOrganizeId() {
        return outOrganizeId;
    }

    public void setOutOrganizeId(String outOrganizeId) {
        this.outOrganizeId = outOrganizeId;
    }

    public String getOutAcctName() {
        return outAcctName;
    }

    public void setOutAcctName(String outAcctName) {
        this.outAcctName = outAcctName;
    }

    public String getOutAcctNo() {
        return outAcctNo;
    }

    public void setOutAcctNo(String outAcctNo) {
        this.outAcctNo = outAcctNo;
    }

    public String getInOrganizeId() {
        return inOrganizeId;
    }

    public void setInOrganizeId(String inOrganizeId) {
        this.inOrganizeId = inOrganizeId;
    }

    public String getInAcctName() {
        return inAcctName;
    }

    public void setInAcctName(String inAcctName) {
        this.inAcctName = inAcctName;
    }

    public String getInAcctNo() {
        return inAcctNo;
    }

    public void setInAcctNo(String inAcctNo) {
        this.inAcctNo = inAcctNo;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
